---@class Battle.AiInSkillRangeCondition:Battle.AiCondition
---@field New fun():Battle.AiInSkillRangeCondition
local AiInSkillRangeCondition = Battle.CreateClass("AiInSkillRangeCondition",Battle.AiCondition)
Battle.AiInSkillRangeCondition = AiInSkillRangeCondition

function AiInSkillRangeCondition:Awake()
    self:SetParamKey(1,"skillId")

end
function AiInSkillRangeCondition:onInitialize()
    self.skillId = self:GetParam("skillId")
    local skill = self:GetActor().skillSystem:GetSkill(self.skillId)
    if skill == nil then return end
    if skill:IsInSkillRange() then
        self:SetCondition(true,true,Battle.CompareType.Equals)
    else
        self:SetCondition(false,true,Battle.CompareType.Equals)
    end
end
function AiInSkillRangeCondition:ToString()
    local s = Battle.AiBehavior.ToString(self)
    return s.." In:"..tostring(self:IsTrigger())
end